/*
 * Copyright (c) 2010 Curtis Boyden.  All rights reserved. 
 * This software was developed by Curtis Boyden and is provided under the terms 
 * of the GNU Lesser General Public License, Version 2.1. You may not use 
 * this file except in compliance with the license. If you need a copy of the license, 
 * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is ejMud
 * (Ewerp Java MUD).  The Initial Developer is Curtis Boyden.
 *
 * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" 
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
 * the license for the specific language governing your rights and limitations.
 */

package com.ewerp.mud.core.plugin;

import java.util.List;

/**
 * ejMud plugins must implement this interface to gain access to the
 * {@link IPluginManager}. The {@link IPluginManager} gives plugins access to
 * other plugins for using their functionality.
 * 
 * {@link IPlugin}s will typically support {@link ILifecycleListener}, or provide
 * functionality through implemented classes, or both.
 * 
 * @author cboyden
 * 
 */

public interface IPlugin {

    /**
     * Associate an {@link IPluginManager} with this {@link IPlugin}.
     * 
     * @param pluginManager
     *            The {@link IPluginManager} with which to associate this
     *            {@link IPlugin} <br />
     *            <ul>
     *            <li>{@link IPluginManager} : A valid plugin manager
     *            implementing {@link IPluginManager}</li>
     *            <li>null : A null value will result in an
     *            {@link IllegalArgumentException}</li>
     *            </ul>
     * @throws IllegalArgumentException
     *             Must be thrown if {@link IPluginManager} is null
     */
    public void registerPluginManager(IPluginManager pluginManager) throws IllegalArgumentException;

    /**
     * The list of interfaces implemented by this class.
     * 
     * @return The list of interfaces implemented by this class. This may be
     *         null if the {@link IPlugin} does not expose any functionality to
     *         the other ejMud {@link IPlugin}s.
     */
    public List<Class<?>> getInterfaces();
}
